const dbConfig = require("../../../utils/dbConfig");

const getCarousel = async (req, res) => {
  try {
    let sql = 'select * from carousel'
    const data = await dbConfig.SySqlConnect(sql, [])
    res.status(200).send({
      code: 200,
      data: data,
      message: "success"
    })
  } catch (e) {
    console.log(e)
    res.status(500).send({
      code: 500,
      data: null,
      message: "服务器出错了"
    })
  }
}

module.exports = {
  getCarousel
}